/////////////
// GLOBALS //
/////////////
cbuffer MatrixBuffer
{
	matrix worldMatrix;
	matrix viewMatrix;
	matrix projectionMatrix;
}

struct VertexInput
{
   float4 position : POSITION;
   float2 tex : TEXCOORD0;
   float3 normal : NORMAL;
};

struct VertexOutput
{
   float4 position : SV_POSITION;
   float2 tex : TEXCOORD0;
   float3 normal : NORMAL;
};


VertexOutput VShader(VertexInput input)
{
   VertexOutput output;
   
   input.position.w = 1.0f;
   
   output.position = mul(input.position, worldMatrix);
   output.position = mul(output.position, viewMatrix);
   output.position = mul(output.position, projectionMatrix);
   
   // Calculate our transformed vertex normals, and make sure they stay normalized
   output.normal = mul(input.normal, (float3x3)worldMatrix);
   output.normal = normalize(output.normal);
   
   // copy the texture info
   output.tex = input.tex;


   return output;
}

